package com.aaa.controller;

import com.aaa.entity.EduTeacher;
import com.aaa.service.TeacherListService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eig.common.entity.AclUser;
import com.eig.common.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 李双奇
 * @Date: 2022/12/07/21:03
 * @Description:
 */
@RestController
@RequestMapping("/core/teacher")
public class TeacherListController {
    @Autowired
    private TeacherListService teacherListService;


    @PostMapping("getTeacherByPage/{current}/{pageSize}")
    public Result<IPage<EduTeacher>> getTeacherByPage(@PathVariable(required = true) Integer current, @PathVariable(required =true ) Integer pageSize,
                                                @RequestBody EduTeacher eduTeacher
    ){
        return teacherListService.queryTeacherList(current,pageSize,eduTeacher);
    }

    /**
     * 教师列表修改信息
     * @param eduTeacher
     * @return
     */
    @PostMapping("/updateTeacher")
    public Result updateTeacher(@RequestBody EduTeacher eduTeacher){
        return teacherListService.updateTeacherList(eduTeacher);
    }

    /**
     * 讲师审核修改状态
     * @param eduTeacher
     * @return
     */
    @PostMapping("/changeStatus")
    private Result changeStatus(@RequestBody EduTeacher eduTeacher){
        return teacherListService.changeStatus(eduTeacher);
    }

}
